Skip to content

Conversation

@lorisleiva
Copy link
Member

@lorisleiva lorisleiva commented Mar 14, 2024

Before adding the “module” package type in #21, tsup was generating CJS files as .js and ESM files as .mjs. After the PR, tsup started doing the opposite — i.e. CJS files as .cjs and ESM files as .js meaning our package.json was pointing to the wrong files.

This PR fixes this by updating the package.json accordingly but also defining the extension logic explicitly so we don’t get this sort of surprise in the future.

Test plan

I've updated @solana-program/system, @solana-program/memo, @solana-program/address-lookup-table and @solana-program/compute-budget with this patch. Before, they didn't work on CodeSandbox, now they do.

Before adding the “module” package type in #21, `tsup` was generating CJS files as `.js` and ESM files as `.mjs`. After the PR, `tsup` started doing the opposite — i.e. CJS files as `.cjs` and ESM files as `.js` meaning our `package.json` was pointing to the wrong files.

This PR fixes this by updating the `package.json` accordingly but also defining the extension logic explicitly so we don’t get this sort of surprise in the future.
@changeset-bot
Copy link

changeset-bot bot commented Mar 14, 2024

🦋 Changeset detected

Latest commit: 236cc68

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-solana-program Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lorisleiva lorisleiva requested a review from steveluscher March 14, 2024 15:05
@lorisleiva lorisleiva self-assigned this Mar 14, 2024
Copy link
Contributor

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did-i-do-that-steve-urkel

@lorisleiva lorisleiva merged commit 289ccfd into main Mar 14, 2024
@github-actions github-actions bot mentioned this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants